home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
MRAC
/
Lengths
/
Modify
/
l-complement
< prev
next >
Wrap
Lisp/Scheme
|
1998-08-11
|
1KB
|
46 lines
l-complement position length type pattern
This function is used to complement existing values in a note-length list with further values to enable the whole list to 'add-up' to a user-defined zone-length.
type :note :rest seed
operator :first :last seed
(setq len1 (qlength '((8-11) (20-11111) (8-11) (12-111))))
(setq pat (l-tie len1))
=> ((1/8) (7/40) (1/20 1/20 1/20) (7/40) (5/24) (1/12 1/12))
(l-complement :first :note '1/4 pat)
=> ((1/8 1/8) (3/40 7/40) (1/10 1/20 1/20 1/20)
(3/40 7/40) (1/24 5/24) (1/12 1/12 1/12))
(l-complement :first :rest '1/4 pat)
=> ((-1/8 1/8) (-3/40 7/40) (-1/10 1/20 1/20 1/20)
(-3/40 7/40) (-1/24 5/24) (-1/12 1/12 1/12))
(l-complement nil nil '1/4 pat)
=> ((-1/8 1/8) (7/40 -3/40) (1/20 1/20 1/20 1/10)
(7/40 -3/40) (5/24 1/24) (1/12 1/12 1/12))
or...
(setq len2 (permute-unique (qlength '(20-10100))))
(setq prime (vector-to-list (gen-primes 18)))
(l-complement nil :note '1/4
(l-modify .45 nil :note :times
(symbol-shuffle prime .32) len2))
=> ((3/20 13/20 11/20 -1/20 -1/20 -1/20)
(3/20 1/10 -1/20 17/20 -1/20 -1/20)
(1/20 -1/20 -1/20 7/20 -1/20 1/5)
(1/4 -1/20 -1/20 -1/20 3/20 1/5)
(3/20 -1/20 13/20 11/20 -1/20 -1/20)
(3/20 -1/20 1/10 -1/20 17/20 -1/20)
(-1/20 1/20 -1/20 -1/20 7/20 1/5)
(-1/20 -1/20 -1/20 1/4 3/20 1/5)
(-1/20 -1/20 13/20 11/20 -1/20 3/20)
(-1/20 -1/20 1/10 -1/20 17/20 3/20))